package com.gz.spring.aop.homework.xml方式;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;


public class MyCalAspect {

    public  void showBeginLog(JoinPoint joinPoint) {
        Signature signature = joinPoint.getSignature();
        System.out.println("XML配置-切面类的showBeginLog-开始执行计算  "+System.currentTimeMillis());//从AOP看，这里是一个横切关注点-前置通知
    }

    public  void showSuccessEndLog(JoinPoint joinPoint,Object res) {
        Signature signature = joinPoint.getSignature();
        System.out.println("XML配置-切面类的showSuccessEndLog-正常结束执行计算  "+System.currentTimeMillis()
        +"\n"+"结果= "+res);//从AOP看，也是一个横切关注点-返回通知
    }

    public  void showExceptionLog(JoinPoint joinPoint,Exception e) {
        Signature signature = joinPoint.getSignature();
        System.out.println("XML配置-切面类的showExceptionLog-执行异常  "+System.currentTimeMillis());//从AOP看，也是一个横切关注点-异常通知
    }

    public  void showFinallyEndLog(JoinPoint joinPoint){
        Signature signature = joinPoint.getSignature();
        System.out.println("XML配置-切面类的showFinallyEndLog-最终执行计算  "+System.currentTimeMillis());//从AOP看，也是一个横切关注点-最终通知
    }
}
